function SrvProject(params){ 
	 
}

SrvProject.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvProject.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvProject.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvProject.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.spId=function(spId){if(this.proxy)return this.getProxy().spId(spId);  this.put("spId", spId);return this;};
	/** and sp_id is null */
	this.spIdNull=function(){if(this.proxy)return this.getProxy().spIdNull();if(this.get("spIdNot")==null)this.put("spIdNot", "");this.put("spId", null);return this;};
	/** not .... */
	this.spIdNot=function(){if(this.proxy)return this.getProxy().spIdNot();this.put("spIdNot", "not");return this;};
	this.spIdNotNull=function(){if(this.proxy)return this.getProxy().spIdNotNull();this.put("spIdNot", "not");this.put("spId", null);return this;};
	this.spIdNot=function(spId){if(this.proxy)return this.getProxy().spIdNot(spId);this.put("spIdNot", "not");this.put("spId", spId);return this;};
		
	/** and sp_id <= ? */
	this.spIdMin=function(min){if(this.proxy)return this.getProxy().spIdMin(min);this.put("spIdMin", min);return this;};
	/** and sp_id >= ? */
	this.spIdMax=function(max){if(this.proxy)return this.getProxy().spIdMax(max);this.put("spIdMax", max);return this;};
		
		
	this.spIdIn=function(ids){
		if(this.proxy)return this.getProxy().spIdIn(ids);  this.put("spIdIn", ids);return this;
	};	
		 
	
	
	/** 项目名称 [非空]       **/
	this.spName=function(spName){if(this.proxy)return this.getProxy().spName(spName);  this.put("spName", spName);return this;};
	/** and sp_name is null */
	this.spNameNull=function(){if(this.proxy)return this.getProxy().spNameNull();if(this.get("spNameNot")==null)this.put("spNameNot", "");this.put("spName", null);return this;};
	/** not .... */
	this.spNameNot=function(){if(this.proxy)return this.getProxy().spNameNot();this.put("spNameNot", "not");return this;};
	this.spNameNotNull=function(){if(this.proxy)return this.getProxy().spNameNotNull();this.put("spNameNot", "not");this.put("spName", null);return this;};
	this.spNameNot=function(spName){if(this.proxy)return this.getProxy().spNameNot(spName);this.put("spNameNot", "not");this.put("spName", spName);return this;};
		
		 
	
	
	/** 父节点 [非空] [SrvProject]      **/
	this.spParentId=function(spParentId){if(this.proxy)return this.getProxy().spParentId(spParentId);  this.put("spParentId", spParentId);return this;};
	/** and sp_parent_id is null */
	this.spParentIdNull=function(){if(this.proxy)return this.getProxy().spParentIdNull();if(this.get("spParentIdNot")==null)this.put("spParentIdNot", "");this.put("spParentId", null);return this;};
	/** not .... */
	this.spParentIdNot=function(){if(this.proxy)return this.getProxy().spParentIdNot();this.put("spParentIdNot", "not");return this;};
	this.spParentIdNotNull=function(){if(this.proxy)return this.getProxy().spParentIdNotNull();this.put("spParentIdNot", "not");this.put("spParentId", null);return this;};
	this.spParentIdNot=function(spParentId){if(this.proxy)return this.getProxy().spParentIdNot(spParentId);this.put("spParentIdNot", "not");this.put("spParentId", spParentId);return this;};
		
		
	this.spParentIdIn=function(ids){
		if(this.proxy)return this.getProxy().spParentIdIn(ids);  this.put("spParentIdIn", ids);return this;
	};	
		 
	
	
	/** 家族        **/
	this.spFamily=function(spFamily){if(this.proxy)return this.getProxy().spFamily(spFamily);  this.put("spFamily", spFamily);return this;};
	/** and sp_family is null */
	this.spFamilyNull=function(){if(this.proxy)return this.getProxy().spFamilyNull();if(this.get("spFamilyNot")==null)this.put("spFamilyNot", "");this.put("spFamily", null);return this;};
	/** not .... */
	this.spFamilyNot=function(){if(this.proxy)return this.getProxy().spFamilyNot();this.put("spFamilyNot", "not");return this;};
	this.spFamilyNotNull=function(){if(this.proxy)return this.getProxy().spFamilyNotNull();this.put("spFamilyNot", "not");this.put("spFamily", null);return this;};
	this.spFamilyNot=function(spFamily){if(this.proxy)return this.getProxy().spFamilyNot(spFamily);this.put("spFamilyNot", "not");this.put("spFamily", spFamily);return this;};
		
		 
	
	
	/** 标识        **/
	this.spFlag=function(spFlag){if(this.proxy)return this.getProxy().spFlag(spFlag);  this.put("spFlag", spFlag);return this;};
	/** and sp_flag is null */
	this.spFlagNull=function(){if(this.proxy)return this.getProxy().spFlagNull();if(this.get("spFlagNot")==null)this.put("spFlagNot", "");this.put("spFlag", null);return this;};
	/** not .... */
	this.spFlagNot=function(){if(this.proxy)return this.getProxy().spFlagNot();this.put("spFlagNot", "not");return this;};
	this.spFlagNotNull=function(){if(this.proxy)return this.getProxy().spFlagNotNull();this.put("spFlagNot", "not");this.put("spFlag", null);return this;};
	this.spFlagNot=function(spFlag){if(this.proxy)return this.getProxy().spFlagNot(spFlag);this.put("spFlagNot", "not");this.put("spFlag", spFlag);return this;};
		
		 
	
	
	/** 项目地址 [非空]       **/
	this.spUrl=function(spUrl){if(this.proxy)return this.getProxy().spUrl(spUrl);  this.put("spUrl", spUrl);return this;};
	/** and sp_url is null */
	this.spUrlNull=function(){if(this.proxy)return this.getProxy().spUrlNull();if(this.get("spUrlNot")==null)this.put("spUrlNot", "");this.put("spUrl", null);return this;};
	/** not .... */
	this.spUrlNot=function(){if(this.proxy)return this.getProxy().spUrlNot();this.put("spUrlNot", "not");return this;};
	this.spUrlNotNull=function(){if(this.proxy)return this.getProxy().spUrlNotNull();this.put("spUrlNot", "not");this.put("spUrl", null);return this;};
	this.spUrlNot=function(spUrl){if(this.proxy)return this.getProxy().spUrlNot(spUrl);this.put("spUrlNot", "not");this.put("spUrl", spUrl);return this;};
		
		 
	
	
	/** Logo        **/
	this.spLogo=function(spLogo){if(this.proxy)return this.getProxy().spLogo(spLogo);  this.put("spLogo", spLogo);return this;};
	/** and sp_logo is null */
	this.spLogoNull=function(){if(this.proxy)return this.getProxy().spLogoNull();if(this.get("spLogoNot")==null)this.put("spLogoNot", "");this.put("spLogo", null);return this;};
	/** not .... */
	this.spLogoNot=function(){if(this.proxy)return this.getProxy().spLogoNot();this.put("spLogoNot", "not");return this;};
	this.spLogoNotNull=function(){if(this.proxy)return this.getProxy().spLogoNotNull();this.put("spLogoNot", "not");this.put("spLogo", null);return this;};
	this.spLogoNot=function(spLogo){if(this.proxy)return this.getProxy().spLogoNot(spLogo);this.put("spLogoNot", "not");this.put("spLogo", spLogo);return this;};
		
		 
	
	
	/** 项目描述        **/
	this.spDescript=function(spDescript){if(this.proxy)return this.getProxy().spDescript(spDescript);  this.put("spDescript", spDescript);return this;};
	/** and sp_descript is null */
	this.spDescriptNull=function(){if(this.proxy)return this.getProxy().spDescriptNull();if(this.get("spDescriptNot")==null)this.put("spDescriptNot", "");this.put("spDescript", null);return this;};
	/** not .... */
	this.spDescriptNot=function(){if(this.proxy)return this.getProxy().spDescriptNot();this.put("spDescriptNot", "not");return this;};
	this.spDescriptNotNull=function(){if(this.proxy)return this.getProxy().spDescriptNotNull();this.put("spDescriptNot", "not");this.put("spDescript", null);return this;};
	this.spDescriptNot=function(spDescript){if(this.proxy)return this.getProxy().spDescriptNot(spDescript);this.put("spDescriptNot", "not");this.put("spDescript", spDescript);return this;};
		
		 
	
	
	/** 优先级        **/
	this.spLevel=function(spLevel){if(this.proxy)return this.getProxy().spLevel(spLevel);  this.put("spLevel", spLevel);return this;};
	/** and sp_level is null */
	this.spLevelNull=function(){if(this.proxy)return this.getProxy().spLevelNull();if(this.get("spLevelNot")==null)this.put("spLevelNot", "");this.put("spLevel", null);return this;};
	/** not .... */
	this.spLevelNot=function(){if(this.proxy)return this.getProxy().spLevelNot();this.put("spLevelNot", "not");return this;};
	this.spLevelNotNull=function(){if(this.proxy)return this.getProxy().spLevelNotNull();this.put("spLevelNot", "not");this.put("spLevel", null);return this;};
	this.spLevelNot=function(spLevel){if(this.proxy)return this.getProxy().spLevelNot(spLevel);this.put("spLevelNot", "not");this.put("spLevel", spLevel);return this;};
		
	/** and sp_level <= ? */
	this.spLevelMin=function(min){if(this.proxy)return this.getProxy().spLevelMin(min);this.put("spLevelMin", min);return this;};
	/** and sp_level >= ? */
	this.spLevelMax=function(max){if(this.proxy)return this.getProxy().spLevelMax(max);this.put("spLevelMax", max);return this;};
		
		
	this.spLevelIn=function(ids){
		if(this.proxy)return this.getProxy().spLevelIn(ids);  this.put("spLevelIn", ids);return this;
	};	
		 
	
	
	/** 扩展权限        **/
	this.spLimitExp=function(spLimitExp){if(this.proxy)return this.getProxy().spLimitExp(spLimitExp);  this.put("spLimitExp", spLimitExp);return this;};
	/** and sp_limit_exp is null */
	this.spLimitExpNull=function(){if(this.proxy)return this.getProxy().spLimitExpNull();if(this.get("spLimitExpNot")==null)this.put("spLimitExpNot", "");this.put("spLimitExp", null);return this;};
	/** not .... */
	this.spLimitExpNot=function(){if(this.proxy)return this.getProxy().spLimitExpNot();this.put("spLimitExpNot", "not");return this;};
	this.spLimitExpNotNull=function(){if(this.proxy)return this.getProxy().spLimitExpNotNull();this.put("spLimitExpNot", "not");this.put("spLimitExp", null);return this;};
	this.spLimitExpNot=function(spLimitExp){if(this.proxy)return this.getProxy().spLimitExpNot(spLimitExp);this.put("spLimitExpNot", "not");this.put("spLimitExp", spLimitExp);return this;};
		
		 
	
	
	/** 项目分组        **/
	this.spGroup=function(spGroup){if(this.proxy)return this.getProxy().spGroup(spGroup);  this.put("spGroup", spGroup);return this;};
	/** and sp_group is null */
	this.spGroupNull=function(){if(this.proxy)return this.getProxy().spGroupNull();if(this.get("spGroupNot")==null)this.put("spGroupNot", "");this.put("spGroup", null);return this;};
	/** not .... */
	this.spGroupNot=function(){if(this.proxy)return this.getProxy().spGroupNot();this.put("spGroupNot", "not");return this;};
	this.spGroupNotNull=function(){if(this.proxy)return this.getProxy().spGroupNotNull();this.put("spGroupNot", "not");this.put("spGroup", null);return this;};
	this.spGroupNot=function(spGroup){if(this.proxy)return this.getProxy().spGroupNot(spGroup);this.put("spGroupNot", "not");this.put("spGroup", spGroup);return this;};
		
		 
	
	
	/** 流程信息        **/
	this.spMind=function(spMind){if(this.proxy)return this.getProxy().spMind(spMind);  this.put("spMind", spMind);return this;};
	/** and sp_mind is null */
	this.spMindNull=function(){if(this.proxy)return this.getProxy().spMindNull();if(this.get("spMindNot")==null)this.put("spMindNot", "");this.put("spMind", null);return this;};
	/** not .... */
	this.spMindNot=function(){if(this.proxy)return this.getProxy().spMindNot();this.put("spMindNot", "not");return this;};
	this.spMindNotNull=function(){if(this.proxy)return this.getProxy().spMindNotNull();this.put("spMindNot", "not");this.put("spMind", null);return this;};
	this.spMindNot=function(spMind){if(this.proxy)return this.getProxy().spMindNot(spMind);this.put("spMindNot", "not");this.put("spMind", spMind);return this;};
		
		 
	
	
	/** 状态 [非空]   1:有效 0:无效     **/
	this.spStatus=function(spStatus){if(this.proxy)return this.getProxy().spStatus(spStatus);  this.put("spStatus", spStatus);return this;};
	/** and sp_status is null */
	this.spStatusNull=function(){if(this.proxy)return this.getProxy().spStatusNull();if(this.get("spStatusNot")==null)this.put("spStatusNot", "");this.put("spStatus", null);return this;};
	/** not .... */
	this.spStatusNot=function(){if(this.proxy)return this.getProxy().spStatusNot();this.put("spStatusNot", "not");return this;};
	this.spStatusNotNull=function(){if(this.proxy)return this.getProxy().spStatusNotNull();this.put("spStatusNot", "not");this.put("spStatus", null);return this;};
	this.spStatusNot=function(spStatus){if(this.proxy)return this.getProxy().spStatusNot(spStatus);this.put("spStatusNot", "not");this.put("spStatus", spStatus);return this;};
		
		
	this.spStatusIn=function(ids){
		if(this.proxy)return this.getProxy().spStatusIn(ids);  this.put("spStatusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有项目菜单 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/permissions/project.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取项目菜单分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/permissions/project.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取项目菜单 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/permissions/project.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvProject.get = function(id){
	var protocol = ux.ajax("/admin/permissions/project.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvProject;
	return null;
}

SrvProject.where = new SrvProject.Where(0,true);